#include <avr/io.h>

// ArduTracker v1.0 - 01/10/2010
// By HappyKillmore (Paul Mather) and Diego Colonnello
// Most of this source comes from ArduPilot 2.3.1 by Chris Anderson & Jordi Munoz
// Current Implementation designed to work with "PanTilt" Output Mode on HappyKillmore's GCS
// http://code.google.com/p/happykillmore-gcs/

// Designed for use with ArduPilot original (not Mega) - http://www.sparkfun.com/search/results?term=ardupilot&what=products
// Connected via FTDI cable - http://www.sparkfun.com/search/results?term=ftdi&what=products
// Pan servo connected to Out 1
// Tilt servo connected to Out 2

int pan=1500;
int tilt=1500; 
byte data_update_event=1;//New data flag 

void setup()
{
    Serial.begin(38400); //Serial  
    Init_servos(); 
    pulse_servos(pan,tilt);
}

void loop()
{
    decode(); //Decoding data comming from GCS
    
    if((data_update_event&0x01)==0x01)
    {
        pulse_servos(pan,tilt);
        data_update_event=0;
    }
}

